# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
# Co-Maintainer: jane400 <jane400@postmarketos.org>
pkgname=firmware-lenovo-21bx
pkgver=3
pkgrel=0
# these are renamed when new versions are released by lenovo
_vid_filename=n3hdr20w # "Qualcomm Graphics Driver" v30.0.3851.4800
pkgdesc="Firmware for the Lenovo Thinkpad X13s (21bx)"
url="https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-x-series-laptops/thinkpad-x13s-type-21bx-21by/downloads/driver-list"
arch="aarch64"
license="proprietary"
options="!check !strip !archcheck !tracedeps pmb:cross-native"
makedepends="innoextract"
source="
	https://download.lenovo.com/pccbbs/mobiles/$_vid_filename.exe
	"

build() {
	innoextract -I drivers/qcvss8280.mbn "$srcdir/$_vid_filename.exe"
}

package() {
	# video acceleration (venus)
	_name_upper="$(echo "$_vid_filename" | tr [:lower:] [:upper:])"
	install -Dm644 "$srcdir"/code\$GetExtractPath\$/"$_name_upper"/drivers/qcvss8280.mbn \
		-t "$pkgdir"/lib/firmware/qcom/sc8280xp/LENOVO/21BX/
}
sha512sums="
d569333b6819024d2142f0330688a0ed3c9f3dfd5d75ab1488d42412f7c8bdb6b83d43b7fa5543fb03a071e23d28d37f86e40272d61c7a14992c4663fc1aa1e6  n3hdr20w.exe
"
